package com.knife.changerecord.domain;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.knife.common.constants.BaseConstants;
import com.knife.lov.infra.annotations.KnifeLovValue;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 变更记录头表
 * @TableName change_record_tx_header
 */
@Data
public class ChangeRecordTxHeader implements Serializable {

    public ChangeRecordTxHeader(String moduleType, Long moduleId, String operationType) {
        this.moduleType = moduleType;
        this.moduleId = moduleId;
        this.operationType = operationType;
    }

    public ChangeRecordTxHeader() {
    }

    /**
     * 
     */
    @TableId
    private Long id;

    /**
     * 模块（ASSET/LIABILITY）
     */
    private String moduleType;

    /**
     * 关联业务ID
     */
    private Long moduleId;

    /**
     * 操作类型
     */
    @KnifeLovValue(lovCode = "OPERATION_TYPE",meaningField = "operationTypeMeaning")
    private String operationType;

    /**
     * 操作人
     */
    private Long operatorId;

    /**
     * 操作时间
     */
    private Date operationTime;

    /**
     * 租户id
     */
    private Long tenantId;

    /**
     * 
     */
    private Long objectVersionNumber;

    /**
     * 
     */
    private Long createdBy;

    /**
     * 
     */
    @JsonFormat(pattern = BaseConstants.Pattern.DATETIME,timezone = "GMT+8")
    @DateTimeFormat(pattern = BaseConstants.Pattern.DATETIME)
    private Date creationDate;

    /**
     * 
     */
    private Long lastUpdatedBy;

    /**
     * 
     */
    @JsonFormat(pattern = BaseConstants.Pattern.DATETIME,timezone = "GMT+8")
    @DateTimeFormat(pattern = BaseConstants.Pattern.DATETIME)
    private Date lastUpdateDate;

    private static final long serialVersionUID = 1L;

    @TableField(exist = false)
    private List<ChangeRecordTxLine> changeRecordTxLineList;
    @TableField(exist = false)
    private String operationTypeMeaning;
    @TableField(exist = false)
    private String createdByName;
}